<template>
  <!-- 整体布局 -->
  <el-container>
    <!-- 头部 -->
    <el-header>Header</el-header>
    <!-- 内容 -->
    <el-main>
      <!-- 轮播图 -->
      <el-carousel :interval="5000" arrow="always" indicator-position="none">
        <el-carousel-item v-for="(item,i) in newList.wallpaper" :key="i">
          <!-- <h3>{{ item }}</h3> -->
          <img :src="item.img" alt="">
        </el-carousel-item>
      </el-carousel>
      <!-- 图主信息 -->
      <div class="author">
        <div class="top">
          <div class="photo">
              <img :src="newList.album.user.avatar" alt="">
          </div>
          <div class="writer">
              {{newList.album.user.name}}
          </div>
        </div>
        <div class="content">
            {{newList.album.desc}}
        </div>
      </div>
      <!-- 图片展示 -->
      <el-row :gutter="10">
        <el-col :xs="8" :sm="6" :md="4" :lg="3" :xl="1" v-for="(item,i) in newList.wallpaper" :key="i">
          <div class="grid-content bg-purple">
              <img :src="item.img" alt="">
          </div>
        </el-col>
      </el-row>
    </el-main>
    <!-- 尾部 -->
    <el-footer>Footer</el-footer>
  </el-container>
</template>
<script>
export default {
  data() {
    return {
      list: ""
    };
  },
  created() {
    this.$store.dispatch("getshow");
  },
  mounted() {
    console.log(this.$store.state.isshowall);
  },
  computed: {
    newList() {
      this.list = this.$store.state.isshowall;
      console.log(this.list);
      return this.$store.state.isshowall;
    },
  }
};
</script>
<style scoped>
/* 主体部分 */
.el-container {
  height: 100%;
}
.el-header,
.el-footer {
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
  padding: 0;
}
/* 轮播图 */
.el-carousel__item h3 {
  color: #475669;
  font-size: 18px;
  opacity: 0.75;
  line-height: 300px;
  margin: 0;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
/* 作者信息 */
.top {
  display: flex;
  padding: 10px;
}
.photo{
    width:10%
}
.writer {
  font-size: 17px;
  font-weight: 700;
  margin-left: 5px;
}
.content {
  color: #5e5957;
  text-align: left;
  padding: 0 13px;
  margin-bottom: 30px;
}
/* 图片展示 */
.el-col {
  border-radius: 4px;
}
.bg-purple-dark {
  background: #99a9bf;
}
.bg-purple {
  background: #d3dce6;
}
.bg-purple-light {
  background: #e5e9f2;
}
.grid-content {
  border-radius: 4px;
  min-height: 36px;
}
/* tu片 */
img{
    width:100%
}
</style>

